﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using BLL;
using Model;
using System.Text;

namespace OA.Controllers
{
    public class MemberInfoController : Controller
    {
        //
        // GET: /MemberInfo/

        public ActionResult Index()
        {
           

            return View();
        }

        public ActionResult MemberInfo()
        {
            if (System.Web.HttpContext.Current.User.Identity.IsAuthenticated)
            {

                return View();
            }
            return RedirectToAction("Login", "Login");
        }
       
        public ActionResult Desktop(int? page)
        {
          
            //var  member=new BLL.memberInfoBLL().GetAll();
            ////int areas=member.
            ////pageSize = pageSize ?? 20;
            ////pageIndex = pageIndex ?? 1;
            ////ViewData["TotalPage"] = Math.Ceiling((double)member.Count()/(double)pageSize.Value);
            ////var tempData = member.OrderBy(u => u.id).Skip<memberInfo>
            ////    (pageSize.Value * (pageIndex.Value - 1)).Take<memberInfo>(pageSize.Value);
            ////ViewData.Model = tempData;

            ////return View();

            ////List<memberInfo> memberInfo = new memberInfoBLL().GetAll().ToList();
            ////return View(memberInfo);
            //PagerInfo pager = new PagerInfo();
            ////memberInfo Meber = new memberInfo();
            
            //pager.RecordCount = member.Count();
            //pager.PageSize = 16;
            //pager.CurrentPageIndex = (page != null ? (int)page : 1);
            //IList<MemberList> result = member.ToList();
            //IList<MemberList> Info = result.Where<MemberList>(id => id.id > (pager.CurrentPageIndex - 1) * pager.PageSize && id.id <= pager.CurrentPageIndex * pager.PageSize).ToList();
            //PagerQuery<PagerInfo, IList<MemberList>> query = new PagerQuery<PagerInfo, IList<MemberList>>(pager, Info);
            return RedirectToAction("Index", "Desktop");
        }

        public ActionResult Footer()
        {
            return RedirectToAction("Index", "Footer");
        }

        public ActionResult Header()
        {
            return RedirectToAction("Index", "Header");
        }

        public ActionResult Line()
        {
            return RedirectToAction("Index", "Line");
        }

        public ActionResult Loading()
        {
            return RedirectToAction("Index", "Loading");
        }

        public ActionResult Menu()
        {
           //string Id = System.Web.HttpContext.Current.Request.QueryString["id"];
            //return RedirectToAction("Index", "Menu", new { id=Id});
          return RedirectToAction("Index", "Menu");
        }
      
    }
}
